<div class="m-page-title m-page-title-b1">
	<h2 class="u-tt">功能管理</h2>
</div>
<form method="post" action=" " onkeypress="if(event.keyCode==13||event.which==13){return false;}">
	<table class="m-table m-table-row" id="table">
		<thead class="m-table-thead s-table-thead">
			<tr>
				<th class="colc">名称</th>
				<th>描述</th>
				<th class="colb">版本</th>
				<th class="colb">作者</th>
				<th class="colc">数据</th>
				<th class="colb">操作</th>
			</tr>
		</thead>
		<tbody>
			<!--{loop="$AppList $key $vo"}-->
			<tr>
				<td>{$vo.APP_NAME}</td>
				<td>{$vo.APP_DESCRIPTION}</td>
				<td>{$vo.APP_VER}</td>
				<td>{$vo.APP_AUTHOR}</td>
				<td data="{$key}"><?php if($vo['APP_INSTALL']&&!$vo['APP_SYSTEM']){ ?>
					<a href="javascript:;" class="backup">备份</a> / <a href="javascript:;" class="restore">恢复</a> / <a href="javascript:;" class="package">打包</a>
					<?php }else{ ?>
					无
					<?php } ?></td>
				<td data="{$key}">
				<?php if(!$vo['APP_SYSTEM']){ ?>
						<?php if(!$vo['APP_INSTALL']){ ?>
							<a href="javascript:;" class="install">安装</a>
						<?php }else{ ?>
							<?php if(!$vo['APP_STATE']){ ?>
								<a href="javascript:;" class="status">启用</a>
							<?php }else{ ?>
								<a href="javascript:;" class="status">禁用</a>
							<?php } ?>
						/ <a href="javascript:;" class="uninstall">卸载</a>
						<?php } ?>
					<?php }else{ ?>
					保留
					<?php } ?></td>
			</tr>
			<!--{/loop}-->
		</tbody>
	</table>
</form>
<script>
Do.ready('base','dialog',function() {
	//状态
	$('.status').duxAjaxConfirm({
		url:'{$url|"AppManage/status"}',
		content:'您确认要更该APP状态吗？',
		params:function(obj){
			return {name:$(obj).parent().attr('data')};
		},
		complete:function(){
			window.setTimeout(function () { window.location.reload(); }, 2000);
		}
	});
	//安装
	$('.install').duxAjaxConfirm({
		url:'{$url|"AppManage/install"}',
		content:'您确认要安装该APP吗？',
		params:function(obj){
			return {name:$(obj).parent().attr('data')};
		},
		complete:function(){
			window.setTimeout(function () { window.location.reload(); }, 2000);
		}
	});
	//卸载
	$('.uninstall').duxAjaxConfirm({
		url:'{$url|"AppManage/uninstall"}',
		content:'您确认要卸载该APP吗？',
		params:function(obj){
			return {name:$(obj).parent().attr('data')};
		},
		complete:function(){
			window.setTimeout(function () { window.location.reload(); }, 2000);
		}
	});
	//备份
	$('.backup').duxAjaxConfirm({
		url:'{$url|"AppManage/backup"}',
		content:'您确认要备份该APP数据吗？',
		params:function(obj){
			return {name:$(obj).parent().attr('data')};
		},
		complete:function(){
			window.setTimeout(function () { window.location.reload(); }, 2000);
		}
	});
	//恢复
	$('.restore').duxAjaxConfirm({
		url:'{$url|"AppManage/restore"}',
		content:'您确认恢复该APP数据吗？',
		params:function(obj){
			return {name:$(obj).parent().attr('data')};
		},
		complete:function(){
			window.setTimeout(function () { window.location.reload(); }, 2000);
		}
	});
	//打包
	$('.package').duxAjaxConfirm({
		url:'{$url|"AppManage/package"}',
		content:'您确认打包该APP数据吗？',
		params:function(obj){
			return {name:$(obj).parent().attr('data')};
		},
		complete:function(){
			window.setTimeout(function () { window.location.reload(); }, 2000);
		}
	});
});
</script>